<script setup>
import Aside from '/src/components/aside.vue'
import Header from '/src/components/navHeader.vue'
import {computed} from "vue";
import {useStore} from "vuex";

const store = useStore()
const isCollapse = computed(()=>store.state.menu.isCollapse)
</script>

<template>
  <div class="common-layout">
    <el-container>
      <!-- 左侧侧边栏 -->
      <el-aside :width="isCollapse?'64px':'230px'">
        <Aside/>
      </el-aside>

      <!-- 右侧主要内容区域（垂直排列） -->
      <el-container direction="vertical">
        <!-- 顶部头部 -->
        <el-header height="60px">
          <Header/>
        </el-header>

        <!-- 主内容区域 -->
        <el-main>
          <RouterView></RouterView>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<style lang="less" scoped>
.common-layout {
  height: 100vh;

  .el-container {
    height: 100%;
  }

  .el-aside {
    background-color: #545c64; /* 深色背景，与图片一致 */
  }

  .el-header {
    background-color: #ffffff; /* 白色头部背景 */
    padding: 0;
    border-bottom: 1px solid #e6e6e6; /* 可选：添加底部边框 */
  }

  .el-main {
    padding: 20px;
    background-color: #f5f5f5; /* 主内容区域背景色 */
  }
}
</style>